package com.levi.utils;

import android.annotation.SuppressLint;
import android.app.Application;
import android.content.Context;

import androidx.annotation.NonNull;

/**
 * 全局context
 * Created by Levi on 2018/3/13.
 */

public final class AppContext {

    private AppContext() {
    }

    @SuppressLint("StaticFieldLeak")
    private static Context sContext;

    public static void init(@NonNull Application application) {
        AppContext.sContext = application.getApplicationContext();
    }

    public static Context getContext() {
        return AppContext.sContext;
    }

    public static void release() {
        AppContext.sContext = null;
    }
}
